package com.ftg.learn.day12;

import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 学习一下多线程类
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/8/24 下午3:36
 */
public class LearnconcurrentHashmap {


//    lock(1) 康 薜
    public static void main(String[] args) {
//        cas : compare and swap
//        synchronized + cas
//        []+node+red/black

        Map<String,String> map = new ConcurrentHashMap<>();

        Stack<String> stack = new Stack<>();
        stack.push("a");
        stack.push("b");
        stack.push("c");

        System.out.println(stack);

        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());

        // c b a
        //a b c
        //b a c
        //b c a

    }

}
